<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<title>我的报价</title> 
	<% include  ./template/commonCss.ejs %>
	<link href="<%=resUrl%>/css/my_offer.css" rel="stylesheet" type="text/css" />
	<% include ./template/commonJs.ejs %>
	<% include ./template/chatLister.ejs %>
</head>

<body ontouchstart>
		<% var topTitle = '我的报价' ;var topReturnType = '';var returnUrl = '/my'%>
		<% include ./template/topReturn.ejs %>
	<div class="weui-tab">
		<div class="tabs" <%if(locals.token && token != ''){%>style="top:0;"<%}%>>
			<a class="item last current" href="javascript:" data-state="-1">
				全部
				<div class="v-line"></div>
			</a>
			<a class="item last" href="javascript:" data-state="0" >
				待确认
				<div class="v-line"></div>
			</a>
			<a class="item last" href="javascript:" data-state="2" >
				被拒绝
				<div class="v-line"></div>
			</a>
			<a class="item last" href="javascript:" data-state="1" >
				已完成
				<div class="v-line"></div>
			</a>
		</div>
	
	</div>	
	<div id="aroundBox" <%if(locals.token && token != ''){%>style="top:1rem;"<%}%> >
			<div class="weui-pull-to-refresh__layer" style="padding: 5px;">
				<div class="weui-pull-to-refresh__arrow"></div>
				<div class="weui-pull-to-refresh__preloader"></div>
				<div class="down">下拉刷新</div>
				<div class="up">释放刷新</div>
				<div class="refresh">正在刷新</div>
			</div>
			<div id="contentTo" >
				<!-- content -->
			</div>
			<div class="weui-loadmore" id="loadmore">
				<i class="weui-loading"></i>
				<span class="weui-loadmore__tips">正在加载</span>
			</div>
			<div class="weui-loadmore weui-loadmore_line" style="display:none;" id="nomore">
				<span class="weui-loadmore__tips">全部加载完毕</span>
			</div>
			
	</div>
			
	<script id="content" type="text/html">
		{{each list}}
		<div class="shoplist-item">
			<div class="shoplist-item-top">	
				<span>出价时间：{{$value.createDate | TimestampToTime}}</span>
				{{if $value.state == 0}}
				<div class="order-top-rig order-top-orange">待确认</div>
				{{else if $value.state == 1}}
					{{if $value.orderDetail.state == 0}}
					<div class="order-top-rig order-top-orange">待付款</div>
					{{else if $value.orderDetail.state == 10}}
					<div class="order-top-rig">待发货</div>
					{{else if $value.orderDetail.state == 20}}
					<div class="order-top-rig order-top-orange">待收货</div>
					{{else if $value.orderDetail.state == 30}}
					<div class="order-top-rig order-top-orange">订单完成</div>
					{{else if $value.orderDetail.state == 31}}
					<div class="order-top-rig order-top-orange">申请退款中</div>
					{{else if $value.orderDetail.state == 32}}
					<div class="order-top-rig order-top-orange">退款中</div>
					{{else if $value.orderDetail.state == 33}}
					<div class="order-top-rig order-top-orange">卖家拒绝退款</div>
					{{else if $value.orderDetail.state == 34}}
					<div class="order-top-rig">已退款</div>
					{{else if $value.orderDetail.state == 40}}
					<div class="order-top-rig">已评价</div>
					{{else if $value.orderDetail.state == 99}}
					<div class="order-top-rig">交易关闭</div>
					{{/if}}
				{{else if $value.state == 2}}
				<div class="order-top-rig order-top-orange">被拒绝</div>
				{{/if}}
			</div>
			<div class="shoplist-item-body">
				<div class="order-body-let" style="width:1.68rem;height:1.68rem;background: url({{$value.productDetail.coverImage}}?x-oss-process=image/resize,w_500) no-repeat 0 center;background-size: 100% auto;">
				</div>	
				<div class="order-body-cen">
					<div class="order-pro-name">{{$value.productDetail.name}}</div>
					<div class="auto-height"></div>
					{{if $value.bidderType && $value.bidderType == 2}}
					<div class="order-img">还价:¥{{$value.bidPrice}} </div>
					{{else}}
					<div class="order-img">我的报价:¥{{$value.bidPrice}}</div>
					{{/if}}
					{{if $value.confirmDate && $value.state == 2}}
					<div class="order-img">拒绝时间:{{$value.confirmDate | TimestampToTime}}</div>
					{{/if}}
					{{if $value.confirmDate && $value.state ==1}}
					<div class="order-img">确认时间:{{$value.confirmDate | TimestampToTime}}</div>
					{{/if}}
				</div>	
				<div class="auto-height"></div>
				 <div class="order-bottom" >
						{{if $value.state == 1}}
						<a href="javascript:visitUrl('/order/detail?id={{$value.orderDetail.id}}',true)">
							<div class="order-bots" >查看订单</div>
						</a>
						{{else if $value.state == 0}}
							{{if $value.bidderType && $value.bidderType == 2}}
							<div class="order-bots" onclick="confirmPay('{{$value.id}}');">确认并付款</div>
							{{/if}}
							<div class="order-bots" onclick="requote('{{$value.id}}');">重新报价</div>
						{{/if}}
						{{if $value.bidHistoryList}}
						<div class="order-bots" onclick="detail('{{$value}}');">详情</div>
						{{/if}}
						
				</div> 
					
			</div>
		</div>
		{{/each}}
	</script>	
	
	<div id="order_detail" class='weui-popup__container'>
			<div class="weui-popup__overlay"></div>
			<div class="weui-popup__modal" style="background-color:#fff">
				<div id="contentDetailsTo"></div>
				<div style="width:50%;height:0.5rem;margin-top:1rem;margin-left:25%">
					<a href="javascript:;" class="weui-btn weui-btn_primary close-popup">关闭</a>
				</div>
				
			</div>
		</div>
		<script id="contentDetails" type="text/html">
			<div style="height:1rem"></div>
			{{each bidHistoryList}}	
			<div class="odetail-express">
				<div class="row1">
					{{if $value.bidderType ==1}}
					我的报价: 
					{{/if}}
					{{if $value.bidderType ==2}}
					卖家还价: 
					{{/if}}
					{{$value.bidPrice}}
				</div>
				<div class="row2">
						{{$value.createDate}}
				</div>
				<div class="auto-height"></div>
			</div>
			{{/each}}
		</script>
	<script type="text/javascript" src="<%=resUrl%>/js/my_offer.js"></script>	
	
</body>

</html>